package cn.iocoder.yudao.module.pay.order.convert;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.api.pay.order.vo.PayOrderVO;
import cn.iocoder.yudao.module.pay.order.dal.dataobject.PayOrderDO;
import cn.iocoder.yudao.module.pay.order.vo.*;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 付款单据 Convert
 *
 * @author aquan
 */
@Mapper
public interface PayOrderConvert {

    PayOrderConvert INSTANCE = Mappers.getMapper(PayOrderConvert.class);

    PayOrderRespVO convert(PayOrderDO bean);

    PayOrderSubmitRespVO convertSubmit(PayOrderDO bean);

    PayOrderVO convertVO(PayOrderDO order);

    PayOrderDetailsRespVO convertDetail(PayOrderDO bean);

    PageResult<PayOrderPageItemRespVO> convertPage(PageResult<PayOrderDO> page);

    default List<PayOrderExcelRespVO> convertList(List<PayOrderDO> list) {
        return CollectionUtils.convertList(list, this::convertExcel);
    }

    PayOrderExcelRespVO convertExcel(PayOrderDO bean);

}
